
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>流程定义</title>
    <link href="../../build/common/base.css" rel="stylesheet">
    <script type="text/javascript" src="../../build/common/base.js"></script>
    <script type="text/javascript" src="../../build/common/gridList.js"></script>
    <script type="text/javascript" src="../../build/common/easyLayout.js"></script>
</head>
<body class="easy-layout">
<div data-options="region:'center',border:false">
    <div class="btn-group toolbar">
        <a href="javascript:void(0)" class="btn btn-outline btn-primary fa-reply" onclick="javascript:$.Dialog.close(window);">返回</a>
        <a class="btn btn-outline btn-primary fa-download" href="javascript:void(0)" onclick="exportbpm()">导出 </a>
    </div>
    <table ab-grid data-id-field="id" data-url="bpm/definition/listJson?isVersions$V=true&key_$VEQ={flowKey}">
        <thead>
        <tr>
            <th data-checkbox="true">序号</th>
            <th data-field="name">流程名称</th>
            <th data-field="key">流程KEY</th>
            <th data-field="desc">描述</th>
            <th data-field="status" data-formatter="labelFormatter" data-value-style="deploy-已发布-primary,forbidden-禁用-warning,draft-草稿-info,">状态</th>
            <th data-field="version">版本</th>
            <th data-field="supportMobile" data-formatter="labelFormatter" data-value-style="1-支持-primary,0-不支持-info,">移动端</th>
            <th data-field="isMain" data-formatter="labelFormatter" data-value-style="Y-是-primary,N-否-warn,">主版本</th>
            <th data-field="createTime" data-formatter="dateFormatter">创建时间</th>
            <th data-field="updateTime" data-formatter="dateTimeFormatter" data-visible="false">更新时间</th>
            <th data-field="id" data-formatter="innerHtmlFormatter" data-title="管理">
                <span class="fa-eye btn btn-outline btn-primary btn-sm" qtip='流程全局配置预览' openDialog="流程配置全局预览【{name}】" top="true" url="/bpm/overallView/overallViewEdit.html?defId={id}"></span>
                <span class="fa-edit btn btn-outline btn-primary btn-sm" qtip='流程设计' openDialog="流程设计  (流程实施方案请参考 <a href='http://www.agilebpm.cn'>www.agilebpm.cn</a> 【敏捷流程实施三步曲】)" top="true" url="/flow-editor/modeler.html?modelId={actModelId}"></span>
                <span if="'{actDefId}'" class="fa-send btn btn-outline btn-primary btn-sm" iview="标记" qtip='启动' openDialog="发起申请【{name}】" top="true" url="/bpm/vueForm/start.html?defId={id}"></span>
                <span if="!'{actDefId}'" class="fa-send btn btn-outline btn-primary btn-sm" qtip='请完成流程设计后再启动流程！'></span>
                <span if="'{isMain}'==='N'" class='btn btn-outline btn-primary fa  fa-thumbs-o-up' sendAction='设为主版本' qtip='设为主版本'  url='/bpm/definition/setMain?id={id}'></span>
            </th>
        </tr>
        </thead>
    </table>
</div>
</body>
<script type="text/javascript">
    $(function(){
        window.setTimeout(function(){
            if($.getParam("type")==='iview'){
                $("[iview]").attr("qtip","发起流程申请请移步至 iview版本 （切换子系统）");
            }
        },1000);
    })
    function exportbpm() {
        var ids = $.getDatagridCheckedId();
        if (!ids || ids.length === 0) {
            $.Dialog.warning("请至少选择一条流程定义！");
            return;
        }
        window.open(__ctx + "/bpm/overallView/exportBpmDefinition?rand=" + Math.random() + "&defIds=" + ids.join(","));
    }
</script>
</html>